package com.util;

import java.util.List;
import java.util.Map;

public class Page<T> {

	private List<T> list;

	private Integer pageSize = 15;

	private Integer curPage = 1;

	private Integer totalCount;

	private Integer totalPage;

	private Integer nextPage;

	private Integer beforePage;

	private Map<String, Object> params;

	public List<T> getList() {
		return list;
	}

	public void setList(List<T> list) {
		this.list = list;
	}

	public Integer getPageSize() {
		return pageSize;
	}

	public void setPageSize(Integer pageSize) {
		this.pageSize = pageSize;
	}

	public Integer getCurPage() {
		return curPage;
	}

	public void setCurPage(Integer curPage) {
		this.curPage = curPage;
	}

	public Integer getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(Integer totalCount) {
		this.totalCount = totalCount;
		this.totalPage=this.totalCount>0?(this.totalCount%this.pageSize==0?this.totalCount/this.pageSize:this.totalCount/this.pageSize+1):1;
	}

	public Integer getTotalPage() {
		return totalPage;
	}
	
	public Integer getNextPage() {
		return this.curPage<this.totalPage?this.curPage+1:this.totalPage;
	}

	

	public Integer getBeforePage() {
		return this.curPage>1?this.curPage-1:this.curPage;
	}

	

	public Map<String, Object> getParams() {
		return params;
	}

	public void setParams(Map<String, Object> params) {
		this.params = params;
	}

	public Page() {
		super();
	}

	public Page(List<T> list) {
		super();
		this.list = list;
	}

}
